import { createRouter, createWebHistory } from "vue-router"

//编写路由设置 并导出
export const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/',
            component: () => import('../views/LoginView.vue')
        },
        {
            path: '/dashboard',
            component: () => import('../views/DashboardView.vue'),
            children: [
                {
                    path: 'user',
                    component: () => import('../views/UserView.vue')
                },
                {
                    path: 'user/:userId',
                    component: () => import('../views/UserDetailView.vue'),
                },
                {
                    path: 'user/input',
                    component: () => import('../views/UserInputView.vue'),
                },
                {
                    path: 'user/edit/:userId',
                    component: () => import('../views/UserInputView.vue'),
                },
                {
                    path: 'activity',
                    component: () => import('../views/ActivityView.vue'),
                },
                {
                    path: 'activity/:activityId',
                    component: () => import('../views/ActivityDetailView.vue'),
                },
                {
                    path: 'clue',
                    component: () => import('../views/ClueView.vue'),
                },
                {
                    path: 'clue/:clueId',
                    component: () => import('../views/ClueDetailView.vue'),
                },
                {
                    path: 'customer',
                    component: () => import('../views/CustomerView.vue'),
                },
                {
                    path: 'customer/:customerId',
                    component: () => import('../views/CustomerDetailView.vue'),
                },
                {
                    path: 'tran',
                    component: () => import('../views/TranView.vue'),
                },
                {
                    path: 'tran/:tranId',
                    component: () => import('../views/TranDetailView.vue'),
                },
                {
                    path: '',
                    component: () => import('../views/StatisticsView.vue'),
                },

            ]
        }
    ]
})